home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Unix / CNews / Source / relay / makefile < prev    next >
Encoding:
Makefile  |  1992-04-29  |  4.9 KB  |  139 lines

  1. # makefile for C news relaynews
  2.  
  3. # =()<NEWSARTS = @<NEWSARTS>@>()=
  4. NEWSARTS = /usr/spool/news
  5. # =()<NEWSBIN = @<NEWSBIN>@>()=
  6. NEWSBIN = /usr/lib/newsbin
  7. # =()<NEWSCTL = @<NEWSCTL>@>()=
  8. NEWSCTL = /usr/lib/news
  9. # workaround for System V make bug
  10. SHELL = /bin/sh
  11.  
  12. I=../include
  13. BIN=/bin
  14. NPROC=2
  15. # -DVOID=int for libc.h & old lint libraries
  16. DEFINES= -I$(I) -I. -DVOID=int -DFLUSHEVERY=6
  17. #CC=agccped
  18. #CC=CC +V
  19. COPTS= -O # -pg -g -O
  20. CFLAGS=$(DEFINES) $(COPTS)
  21. DBM = # -ldbm
  22. #LIBS= $(DBM) /usr/lib/debug/malloc.o
  23. LIBS= $(DBM)
  24. LINT=lint
  25. LINTFLAGS=-haz $(DEFINES)
  26. LLIBS= # -lmalloc
  27. # I wish I could make lint shut the fk up about some things.  Grrr!
  28. LINTFILT=egrep -v '(possible pointer|long assign|nnfree|getdate|:$$)'
  29. PROPTS=
  30. P=stpr
  31. PP=pp -Tpsc -fR # lazywriter
  32. PPBACK=dps | stps # lazywriter
  33.  
  34. LIBOBJS=../libcnews.a
  35. SRC=relaynews.c active.c article.c caches.c mkdirs.c control.c fileart.c \
  36.     hdrdefs.c hdrparse.c hdrmunge.c \
  37.     history.c io.c msgs.c procart.c \
  38.     sys.c transmit.c trbatch.c ihave.c $(LIBSRCS) \
  39.     morefds.c
  40. OBJ=relaynews.o active.o article.o caches.o mkdirs.o control.o fileart.o \
  41.     hdrdefs.o hdrparse.o hdrmunge.o \
  42.     history.o io.o msgs.o procart.o \
  43.     sys.o transmit.o trbatch.o ihave.o \
  44.     morefds.o
  45. FILES=$(NONCFILES) $(CFILES)
  46. NONCFILES= TODO* README ads/README ads/[0-9]* makefile
  47. CFILES= $(I)/*.h \
  48.     active.h article.h batchnames.h caches.h mkdirs.h control.h fileart.h \
  49.     hdrint.h headers.h history.h system.h transmit.h $(SRC)
  50.  
  51. all: makefile relaynews
  52.     chmod +x aux/[a-z]* ctl/[a-z]*
  53.  
  54. mkfile: makefile
  55.     sed '/mkfile/d' makefile | mkconv | sed 's/make/mk/g' >$@
  56.  
  57. relaynews: $(OBJ) $(LIBOBJS)
  58.     $(CC) $(CFLAGS) $(LDFLAGS) $(OBJ) $(PRE) $(LIBS) $(LIBOBJS) $(POST) -o $@
  59. lint: $(SRC)
  60.     $(LINT) $(LINTFLAGS) $(SRC) $(LLIBS) 2>&1 | $(LINTFILT)
  61. lint-p: $(SRC)
  62.     $(LINT) $(LINTFLAGS) -p $(SRC) $(LLIBS) 2>&1 | $(LINTFILT)
  63.  
  64. newsinstall:
  65.  
  66. # bininstall: make directories, install programs
  67. bininstall: install
  68. install: $(NEWSBIN)/relay/relaynews
  69. $(NEWSBIN)/relay/relaynews: relaynews
  70.     -mkdir $(NEWSBIN)/relay $(NEWSBIN)/ctl
  71.     cp ctl/[a-z]* $(NEWSBIN)/ctl
  72.     cp aux/[a-z]* $(NEWSBIN)/relay
  73.     rm -f $(NEWSBIN)/relay/relaynews
  74.     cp relaynews $(NEWSBIN)/relay
  75.     : needs to be news-owned, setuid -- build looks after that
  76.  
  77. cmp:    relaynews
  78.     cmp $(NEWSBIN)/relay/relaynews relaynews
  79.     for f in `../xls ctl | egrep -v alternate` ; do cmp $(NEWSBIN)/ctl/$$f ctl/$$f ; done
  80.     for f in `../xls aux` ; do cmp $(NEWSBIN)/relay/$$f aux/$$f ; done
  81.     ls -lg $(NEWSBIN)/relay/relaynews | egrep -s '^-rwsrwsr-x  1 news     news'
  82.  
  83. check:    relaynews
  84.     cmp $(NEWSBIN)/relay/relaynews relaynews || true
  85.     for f in `../xls ctl | egrep -v alternate` ; do cmp $(NEWSBIN)/ctl/$$f ctl/$$f || true ; done
  86.     for f in `../xls aux` ; do cmp $(NEWSBIN)/relay/$$f aux/$$f || true ; done
  87.     ls -lg $(NEWSBIN)/relay/relaynews | egrep -s '^-rwsrwsr-x  1 news     news'
  88.  
  89. TODO.grep: TODO
  90.     -egrep TODO $(I)/*.h *.h *.c | tr -s " \11" " " >$@
  91.     -egrep TODO ../lib*/*.[ch] | tr -s " \11" " " >>$@
  92.  
  93. print: printc printnonc
  94.     touch $@
  95. printc: $(CFILES)
  96.     $(PP) $? | $(PPBACK)
  97.     touch $@
  98. printnonc: $(NONCFILES)
  99.     pr $(PROPTS) $? | $P
  100.     touch $@
  101. clean:
  102.     rm -rf core a.out relaynews *.o    regress/tmp
  103.  
  104. r:    relaynews
  105.     chmod +x regress/regress
  106.     (cd regress; sh regress)
  107.     
  108. # header dependencies follow
  109. active.o: $(I)/libc.h $(I)/news.h $(I)/config.h active.h
  110. article.o: $(I)/libc.h $(I)/news.h headers.h article.h
  111. caches.o: $(I)/news.h active.h caches.h transmit.h
  112. control.o: $(I)/libc.h $(I)/news.h $(I)/case.h $(I)/config.h control.h headers.h
  113. control.o: article.h caches.h history.h
  114. fileart.o: $(I)/fixerrno.h $(I)/libc.h $(I)/news.h $(I)/config.h control.h active.h
  115. fileart.o: fileart.h mkdirs.h headers.h article.h history.h $(I)/ngmatch.h
  116. fileart.o: system.h
  117. hdrdefs.o: $(I)/libc.h $(I)/news.h headers.h hdrint.h
  118. hdrmunge.o: $(I)/libc.h $(I)/news.h $(I)/case.h fileart.h headers.h article.h
  119. hdrmunge.o: hdrint.h $(I)/msgs.h
  120. hdrparse.o: $(I)/libc.h $(I)/news.h control.h $(I)/case.h fileart.h headers.h
  121. hdrparse.o: hdrint.h
  122. history.o: $(I)/fixerrno.h $(I)/libc.h $(I)/news.h $(I)/config.h $(I)/dbz.h $(I)/fgetmfs.h
  123. history.o: headers.h article.h history.h $(I)/msgs.h
  124. ihave.o: $(I)/libc.h $(I)/news.h $(I)/config.h batchnames.h headers.h article.h
  125. ihave.o: history.h $(I)/fgetmfs.h $(I)/msgs.h transmit.h
  126. io.o: $(I)/news.h headers.h article.h $(I)/msgs.h
  127. mkdirs.o: $(I)/libc.h $(I)/news.h
  128. msgs.o: $(I)/news.h headers.h article.h $(I)/msgs.h rmsgs.h
  129. procart.o: $(I)/libc.h $(I)/news.h active.h control.h headers.h article.h
  130. procart.o: history.h io.h $(I)/msgs.h $(I)/ngmatch.h system.h transmit.h
  131. relaynews.o: $(I)/fixerrno.h $(I)/libc.h $(I)/news.h $(I)/config.h $(I)/fgetmfs.h
  132. relaynews.o: active.h caches.h fileart.h headers.h history.h transmit.h
  133. sys.o: $(I)/fixerrno.h $(I)/libc.h $(I)/fgetmfs.h $(I)/news.h $(I)/config.h batchnames.h
  134. sys.o: $(I)/ngmatch.h system.h
  135. transmit.o: $(I)/libc.h $(I)/news.h $(I)/config.h headers.h active.h article.h
  136. transmit.o: $(I)/msgs.h $(I)/ngmatch.h system.h $(I)/trbatch.h transmit.h
  137. trbatch.o: $(I)/hdbm.h $(I)/hash.h $(I)/libc.h $(I)/news.h $(I)/config.h $(I)/msgs.h
  138. trbatch.o: $(I)/trbatch.h
  139.